package com.lyl.domaindemo.resource.export;

import com.lyl.domaindemo.Infrastructure.CommonResults;
import com.lyl.domaindemo.application.export.CommonExportUseCase;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lyl
 * @date 2023/5/31
 */
@RestController
public class CommonExport {

    private final CommonExportUseCase exportUseCase;

    public CommonExport(CommonExportUseCase exportUseCase) {
        this.exportUseCase = exportUseCase;
    }

    @GetMapping("/export")
    public CommonResults export(@RequestParam("id") String id, Pageable pageable){
        Object export = exportUseCase.commonExport(id, pageable);
        return CommonResults.success(export);
    }

}
